package org.jeasy.mvc.validate;

import org.jeasy.mvc.validate.annotation.Pattern;

public class ValidatePattern implements ValidateStrategy {
    private String regexp;
    private boolean mark;
	@Override
	public boolean doCheck(String parameter,Object obj) {
		Pattern pattern=(Pattern)obj;
		regexp=pattern.regexp();
		if(regexp!=null && !"".equals(regexp)) {
		  mark=parameter.matches(regexp)?true:false;	
		}
		return mark;
	}

}
